package cn.tedu.home1ess.admin.traffic.controller;

import cn.tedu.home1ess.admin.traffic.pojo.vo.MapTrafficVO;
import cn.tedu.home1ess.admin.traffic.pojo.vo.RecentTrafficVO;
import cn.tedu.home1ess.admin.traffic.pojo.vo.TopTrafficVO;
import cn.tedu.home1ess.admin.traffic.service.ITrafficService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

@RestController
@RequestMapping("/traffic")
public class TrafficController {

    @Autowired
    private ITrafficService trafficServiceImpl;

    @GetMapping("mapTraffic")
    public List<MapTrafficVO> mapTraffic() {
        List<MapTrafficVO> list = trafficServiceImpl.getMapTraffic();
        return list;
    }

    @GetMapping("topTraffic")
    public List<TopTrafficVO> topTraffic() {
        List<TopTrafficVO> list = trafficServiceImpl.getTopTraffic();
        return list;
    }

    @GetMapping("recentTraffic")
    public List<RecentTrafficVO> recentTraffic() {
        List<RecentTrafficVO> list = trafficServiceImpl.getRecentTraffic();
        return list;
    }

    @PostMapping("userCount")
    public void userCount() {
        trafficServiceImpl.userCount();
    }
    @PostMapping("trafficCount")
    public void trafficCount() {
        trafficServiceImpl.trafficCount();
    }
}
